package peer.share;

import peer.tools.Mdb;

public class BlockIndexIdent {
	int hashCode;
	Mdb mdb;
	int blockNum;
	BlockIndexIdent(Mdb mdb,int blockNum){
		this.mdb=mdb;
		this.blockNum=blockNum;
		hashCode=(mdb.toString()+Integer.toString(blockNum)).hashCode();
	}
	
	@Override
	public int hashCode(){
		return hashCode;
	}
	
	@Override
	public boolean equals(Object ob){
		BlockIndexIdent bi=(BlockIndexIdent)ob;
		if(bi==null){
			return false;
		}else{
			return bi.mdb.equals(mdb)&bi.blockNum==blockNum;
		}
	}
}
